\begin{tikzpicture}

	\definecolor{appcolor}        {rgb}{1,1,0.7}
	\definecolor{defaultcolor}    {rgb}{1,1,1}
	\definecolor{criticalcolor}   {rgb}{0.9,0.5,0.4}
	\definecolor{kernelcolor}     {rgb}{0.6,0.8,0.7}
	\definecolor{drivercolor}     {rgb}{0.6,0.7,0.8}

	\tikzstyle{treenode} = [component, path fading=flow fade, align=center,
	                        rounded corners=1, minimum height=6ex]

	\tikzstyle{service} = [draw=black, draw opacity=0.4, ball color=defaultcolor, fill opacity=0.2,
	                       rounded corners=0, shape=semicircle,
	                       inner sep=1.3ex, outer sep=0, above]

	\tikzstyle{appnode}    = [treenode, bottom color=appcolor]
	\tikzstyle{kernelnode} = [treenode, bottom color=kernelcolor, minimum width=80ex]
	\tikzstyle{drivernode} = [treenode, bottom color=drivercolor]
	\tikzstyle{muxnode}    = [treenode, bottom color=criticalcolor]

	%
	% Components
	%

	% kernel
	\node[kernelnode] (kernel) {Kernel};

	% core / init
	\node[above=1ex of kernel, kernelnode] (core) {Core / Init};

	\path (core.north) node[service, xshift=-16ex, scale=0.4] (irqservice) {};
	\path (irqservice) node[scale=0.7, yshift=-2ex] {IRQ};

	\path (core.north) node[service, xshift=16ex, scale=0.4] (mmioservice) {};
	\path (mmioservice) node[scale=0.7, yshift=-2ex] {MMIO};

	% platform driver
	\node[drivernode, minimum width=80ex, above=4ex of core] (platformdrv) {Platform Driver};
	\path (platformdrv.north) node[service, scale=0.4] (platformservice) {};
	\path (platformdrv.north) node[scale=0.7, yshift=-1.5ex] {Platform};

	% drivers
	\node[drivernode, minimum width=26ex, above=4ex of platformdrv, xshift=-27ex] (fbdrv)  {Intel FB Driver};
	\path (fbdrv.north) node[service, scale=0.4] (fbservice) {};
	\path (fbservice) node[scale=0.7, yshift=-2ex] {Framebuffer};

	\node[drivernode, minimum width=26ex, above=4ex of platformdrv, xshift=0ex]   (usbdrv) {USB Host Driver};
	\path (usbdrv.north) node[service, scale=0.4] (usbservice) {};
	\path (usbservice) node[scale=0.7, yshift=-2ex] {USB};

	\node[drivernode, minimum width=26ex, above=4ex of platformdrv, xshift=27ex]  (ps2drv) {PS/2 Driver};
	\path (ps2drv.north) node[service, scale=0.4] (ps2service) {};
	\path (ps2service) node[scale=0.7, yshift=-2ex] {Input};

	\node[drivernode, minimum width=26ex, above=4ex of usbdrv, xshift=0ex] (usbhiddrv) {USB HID Driver};
	\path (usbhiddrv.north) node[service, scale=0.4] (usbhidservice) {};
	\path (usbhidservice) node[scale=0.7, yshift=-2ex] {Input};

	\node[treenode, minimum width=53ex, above=4ex of usbhiddrv, xshift=13.5ex] (inputfilter) {Input Filter};
	\path (inputfilter.north) node[service, scale=0.4] (inputfilterservice) {};
	\path (inputfilterservice) node[scale=0.7, yshift=-2ex] {Input};

	% nitpicker GUI server
	\node[muxnode, minimum width=80ex, above=4ex of inputfilter, xshift=-13.5ex] (nitpicker) {Nitpicker GUI Server};
	\path (nitpicker.north) node[service, scale=0.4] (nitpickerservice) {};
	\path (nitpicker.north) node[scale=0.7, yshift=-1.5ex] {GUI};

	% Window manager
	\node[muxnode, minimum width=40ex, above=4ex of nitpicker, xshift=-20ex] (wm) {Window Manager};
	\path (wm.north) node[service, scale=0.4] (wmservice) {};
	\path (wm.north) node[scale=0.7, yshift=-1.5ex] {GUI};

	% Nitpicker clients
	\node[appnode, minimum width=8ex, above=4ex of nitpicker, xshift=5ex] (pointer) {Pointer};
	\node[appnode, minimum width=8ex, right=1ex of pointer] (backdrop) {Backdrop};
	\node[appnode, minimum size=5ex, right=1ex of backdrop] (app) {};
	\node[appnode, minimum size=4ex, right=1ex of app] (app) {};
	\node[appnode, minimum size=3ex, right=1ex of app] (app) {};
	\node[appnode, minimum size=2ex, right=1ex of app] (app) {};
	\node[appnode, minimum size=1ex, right=1ex of app] (app) {};

	% Window manager clients
	\node[appnode, minimum width=8ex, above=4ex of wm, xshift=-15ex] (decorator) {Decorator};
	\node[appnode, minimum width=8ex, right=1ex of decorator] (browser)  {Web Browser};
	\node[appnode, minimum width=8ex, right=1ex of browser]   (terminal) {Terminal};
	\node[appnode, minimum width=8ex, right=1ex of terminal]  (textedit) {Text Editor};
	\node[appnode, minimum size=5ex, right=1ex of textedit] (app) {};
	\node[appnode, minimum size=4ex, right=1ex of app] (app) {};
	\node[appnode, minimum size=3ex, right=1ex of app] (app) {};
	\node[appnode, minimum size=2ex, right=1ex of app] (app) {};
	\node[appnode, minimum size=1ex, right=1ex of app] (app) {};

	%
	% Sessions
	%
	\tikzstyle{treesessionarrow} = [arrow, thick]
	\path[treesessionarrow] (inputfilterservice |- nitpicker.south)   -- (inputfilterservice);
	\path[treesessionarrow] (usbhidservice      |- inputfilter.south) -- (usbhidservice);
	\path[treesessionarrow] (usbservice         |- usbhiddrv.south)   -- (usbservice);
	\path[treesessionarrow] (ps2service         |- inputfilter.south) -- (ps2service);
	\path[treesessionarrow] (fbservice          |- nitpicker.south)   -- (fbservice);
	\path[treesessionarrow] (irqservice         |- platformdrv.south) -- (irqservice);
	\path[treesessionarrow] (mmioservice        |- platformdrv.south) -- (mmioservice);
	\path[treesessionarrow] (platformservice    |- usbdrv.south)      -- (platformservice);
	\path[treesessionarrow] (fbdrv.south)    .. controls +(0,-2ex)    and +(-2ex,2ex) .. (platformservice);
	\path[treesessionarrow] (ps2drv.south)   .. controls +(0,-2ex)    and +(2ex,2ex)  .. (platformservice);
	\path[treesessionarrow] (wm.south)       .. controls +(0,-2ex)    and +(-2ex,2ex) .. (nitpickerservice);
	\path[treesessionarrow] (pointer.south)  .. controls +(-1ex,-2ex) and +(1ex,2ex)  .. (nitpickerservice);
	\path[treesessionarrow] (backdrop.south) .. controls +(0,-2ex)    and +(4ex,2ex)  .. (nitpickerservice);

	\path[treesessionarrow] (decorator.south) .. controls +(0,-2ex) and +(-4ex,2ex) .. (wmservice);
	\path[treesessionarrow] (browser.south)   .. controls +(0,-2ex) and +(-1ex,2ex) .. (wmservice);
	\path[treesessionarrow] (terminal.south)  .. controls +(-1,-2ex) and +(1ex,3ex) .. (wmservice);
	\path[treesessionarrow] (textedit.south)  .. controls +(0,-2ex) and +(4ex,2ex)  .. (wmservice);

	\tikzstyle{risk} = [rectangle callout, fill=red!80!black, rounded corners=3, text=white]

	\path (fbdrv.north east)+(3ex,4ex)
		node [risk, callout relative pointer={(-3ex,-3ex)}, scale=1.5] {highly complex};

	\path (usbhiddrv.north west)+(-4ex,4ex)
		node [risk, callout relative pointer={(3ex,-3ex)}, scale=1.5] {exposed to flaky devices};

\end{tikzpicture}
